package day1.homework.one;

/**
 * @创建人 MBY381
 * @创建时间 2022/6/27 14:33
 * @描述 暂无
 */

public class Node<T> {
    private T value;
    private Node<T> next;
    private Node<T> pre;

    public Node(T value) {
        super();
        this.value = value;
    }


    @Override
    public String toString() {
        return "< "+this.value.toString()+" >";
    }

    public boolean equals(Object object){
        if (this == object) {
            return true;
        }
        else if(object instanceof Node){
            Node node=(Node)object;
            if((node.getValue().equals(this.value))){
                return true;
            }
        }
        return false;
    }


    public Node<T> getNext() {
        return next;
    }
    public void setNext(Node<T> next) {
        this.next = next;
    }
    public Node<T> getPre() {
        return pre;
    }
    public void setPre(Node<T> pre) {
        this.pre = pre;
    }
    public T getValue() {
        return value;
    }
    public void setValue(T value) {
        this.value = value;
    }

}